package com.techstar.ats.codec.live.decoder;

import io.netty.buffer.ByteBuf;
import com.techstar.ats.codec.MessageDecoder;
import com.techstar.ats.codec.StringCodec;
import com.techstar.ats.dxp.live.rep.F11TrainIndicationRemove;
import com.techstar.ats.type.DeviceType;

public enum F11TrainIndicationRemoveDecoder implements MessageDecoder<F11TrainIndicationRemove> {
	INSTANCE;

	public F11TrainIndicationRemove create() {
		return new F11TrainIndicationRemove();
	}

	public void decode(ByteBuf buf, F11TrainIndicationRemove value) {
		value.line = buf.readUnsignedShort();
		value.rtu = buf.readUnsignedShort();
		value.mmccWin = buf.readUnsignedShort();
		value.mmccWinOffset = buf.readUnsignedByte();
		value.devType = DeviceType.valueOf(buf.readUnsignedShort());
		value.devName = (new StringCodec(24)).get(buf);
		value.trainIdx = (new StringCodec(10)).get(buf);
		value.group = (new StringCodec(9)).get(buf);
	}
}
